package practise.alogrithm.hundredInterviewQuestions.secondTime;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Richard on 7/26/2014.
 */
public class Fibonacci {
    public List<Integer> get(int n){
        List<Integer> results = new ArrayList<>(n);
        results.add(0);
        results.add(1);
        for(int index=2;index<=n;index++){
            results.add(results.get(index-1)+results.get(index-2));
        }
        return results;
    }

    public static void main(String[] args){
        System.out.print("Result:"+new Fibonacci().get(10));
    }
}
